package com.wysql.common.model.vo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.wysql.common.market.AggregateRoot;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * 返回给前端页面的菜单vo
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class SysMenuVo implements AggregateRoot {

    /**
     * 菜单id
     */
    @JsonIgnore
    private Integer id;
    /**
     * pid
     */
    @JsonIgnore
    private Integer pid;


    /**
     * 菜单名称
     */
    private String label;

    /**
     * 菜单图标
     */
    private String icon;

    /**
     * 根目录 name 不知道干嘛的 type = 0
     */
    private String name;

    /**
     * 跳转到页面 type = 1
     */
    private String to;

    private boolean visible = true;

    /**
     * 子菜单
     */
    private List<SysMenuVo> children;

    private Config config = new Config();

    @Data
    public static class Config {
        /**
         * 权限
         */
        private List<AuthorityValue> authority = new ArrayList<>();
        private String url;
    }

    @Data
    public static class AuthorityValue {
        private String name;
        private String url;
    }
}
